package com.homework;

import java.io.File;
import java.util.Scanner;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/3/28 17:28
 * @description
 */
public class T3 {
    public static void main(String[] args) {
//        File dir = new File("D:\\file\\test\\dir3");
        Scanner input = new Scanner(System.in);
        System.out.println("请输入文件夹路径：");
        String Path = input.nextLine();
        File dir = new File(Path);
        dil(dir);
    }

    public static void dil(File file){
        if (file.isDirectory()){
            File[] files = file.listFiles();
            for (File f : files) {
                dil(f);
            }
            file.delete();
        }else {
            file.delete();
        }
    }
}
